package com.ncloud.product.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import com.ncloud.product.entity.DiscntPrice;

@Mapper
public interface PriceMapper{

	@Select("select * from bs_p_discnt_price where price_id = #{priceId} and now() between eff_date and exp_date")
	@Results({@Result(column="price_id",property="priceId"),@Result(column="price_name",property="priceName"),
		@Result(column="prod_id",property="prodId"),@Result(column="discnt_id",property="discntId"),
		@Result(column="fee_type",property="feeType"),@Result(column="fee_value",property="feeValue"),
		@Result(column="fee_unit_type",property="feeUnitType"),
		@Result(column="fee_code",property="feeCode"),@Result(column="create_date",property="createDate"),
		@Result(column="eff_date",property="effDate"),@Result(column="exp_date",property="expDate"),
		@Result(column="cretae_user",property="createUser"),@Result(column="update_date",property="updateDate"),
		@Result(column="update_user",property="updateUser"),@Result(column="remark",property="remark")})
	DiscntPrice getByPriceId(Long priceId);

	@Select("select * from bs_p_discnt_price where discnt_id = #{discntId} and now() between eff_date and exp_date")
	@Results({@Result(column="price_id",property="priceId"),@Result(column="price_name",property="priceName"),
		@Result(column="prod_id",property="prodId"),@Result(column="discnt_id",property="discntId"),
		@Result(column="fee_type",property="feeType"),@Result(column="fee_value",property="feeValue"),
		@Result(column="fee_unit_type",property="feeUnitType"),
		@Result(column="fee_code",property="feeCode"),@Result(column="create_date",property="createDate"),
		@Result(column="eff_date",property="effDate"),@Result(column="exp_date",property="expDate"),
		@Result(column="cretae_user",property="createUser"),@Result(column="update_date",property="updateDate"),
		@Result(column="update_user",property="updateUser"),@Result(column="remark",property="remark")})
	List<DiscntPrice> getDiscntPriceByDiscnt(Long discntId);

}
